package com.jiashihui.schema_lgorithm.schema.mediator;

/**
 * @author jiashihui
 * @describe: 具体的中介（如PM充当前端工程师和后端工程师的中介，让他们协同工作）
 * @date 2019/03/15
 */
public class MediatorImpl implements Mediator {

    /* 前端开发工程师 */
    private FrontEndDeveloper frontEndDeveloper;

    /* 后端开发工程师 */
    private BackEndDeveloper backEndDeveloper;

    @Override
    public void createMediator() {
        frontEndDeveloper = new FrontEndDeveloper(this);
        backEndDeveloper = new BackEndDeveloper(this);
    }

    @Override
    public void worKTogether() {
        frontEndDeveloper.work();
        backEndDeveloper.work();
    }

    public FrontEndDeveloper getFrontEndDeveloper() {
        return frontEndDeveloper;
    }

    public BackEndDeveloper getBackEndDeveloper() {
        return backEndDeveloper;
    }

}
